﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OA.Model
{
    public class EmployeeVoteView
    {
        public int ID { get; set; }

        public int VoteID { get; set; }

        public string EmpID { get; set; }

        public DateTime? FillingDate { get; set; }

        public int Status { get; set; }

        [NotMapped]
        public string StatusName { get { if (this.Status == 0) { return "未填写"; } else { return "已填写"; } } }

        public string Title { get; set; }

        public DateTime StartTime { get; set; }

        public DateTime EndTime { get; set; }

        [NotMapped]
        public int AbleEdit { get {
                if (this.Status == 0) return 1;
                if (DateTime.Now >= this.StartTime && DateTime.Now <= this.EndTime) return 1;
                return 0;
            
            } }
    }




}
